<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
<script type="text/javascript" src="../lib/html5.js"></script>
<script type="text/javascript" src="../lib/respond.min.js"></script>
<script type="text/javascript" src="../lib/PIE_IE678.js"></script>
<![endif]-->
    <link href="../css/H-ui.min.css" rel="stylesheet" type="text/css" />
    <link href="../css/H-ui.admin.css" rel="stylesheet" type="text/css" />
    <link href="../lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
    <link href="../lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
    <!--[if IE 6]>
<script type="text/javascript" src="../lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
    <title>工程工艺</title>
</head>
<body>
    <div class="pt-5  pl-20 pr-20 pb-20">
        <form id="itemEdit" name="itemEdit" method="post" action="../ashx/spui.ashx" class="form form-horizontal">
            <input type="hidden" class="actionValue" id="editAction" name="action" value="add" />
            <input type="hidden" id="id" name="id" />
            <input type="hidden" id="tablename" name="tablename" value="" />
            <input type="hidden" id="tablemidname" name="tablemidname" value="" />
            <input type="hidden" id="ftype" name="ftype" value="20170513" />
            <input type="hidden" id="hcrainbackid" name="hcrainbackid" value="1" />
            <input type="hidden" id="ffhcrwfadduser" name="ffhcrwfadduser" value="" />
            <div id="tab-category" class="HuiTab">
                <div class="tabBar cl" id="tab-categorybar">
                    <span>工程工艺</span><span>组件管理</span><span>图片</span><span>流程日志</span>
                </div>

                <div class="tabCon" id="divtab1">
                    <div id="divshow1">
                        <div class="row cl">
                            <label class="form-label col-1">工程说明：</label>
                            <div class="formControls col-8">
                                <textarea name="ffv1" id="ffv1" cols="" rows="" class="textarea" placeholder="说点什么.." onkeyup="textarealength(this,200)"></textarea>
                                <p class="textarea-numberbar"><em class="textarea-length">0</em>/200</p>
                            </div>
                        </div>

                    </div>
                </div>
                <div class="tabCon" id="divtab2">
                    <div id="divshow2">
                        <div class="panel panel-default    mt-20">
                            <div class="panel-header"><a href="javascript:;" onclick="addWfNext()" class="btn btn-danger  round"><i class="Hui-iconfont">&#xe600;</i>添加组件</a></div>
                            <div>
                                <table class="table table-border table-bordered table-striped table-hover" id="tablelist" width="100%">
                                    <thead>
                                        <tr class="text-c">
                                            <th width="30"><a id="hcmtable_sall" onclick="hcmtable_sall();" href="javascript:;" title="全选反选"><i class="Hui-iconfont">&#xe608;全</i></a></th>
                                            <th>分类</th>
                                            <th>品名/图号</th>
                                            <th>规格/名称</th>
                                            <th>数量</th>
                                            <th>单位</th>
                                            <th>备注</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="tabCon" id="divtab3">
                    <div id="divshow3">
                        <input type="hidden" id="ffv10" name="ffv10" value="" />
                        <div class="row cl">
                            <div class="col-2">相片<img id="imgExist" src="" width="110px" height="150px"></div>
                            <div class="col-8">
                                <div id="uploadfileQueue" style="padding: 3px;"></div>
                                <div id="file_upload"></div>
                                <br />
                                <img alt="" src="../uploadifyjs/images/BeginUpload.gif" width="77" height="23" onclick="doUplaod()" />
                                <img alt="" src="../uploadifyjs/images/CancelUpload.gif" width="77" height="23" onclick="closeLoad()" />
                            </div>

                        </div>


                    </div>
                </div>
                <div class="tabCon" id="divtab4">
                    <div id="divshow4">
                        <div id="divforhcrainwflog">
                        </div>
                    </div>
                </div>

            </div>
            <div class="cl" style="display: none;" id="fold_category">
                <ul id="Huifold2" class="Huifold">
                    <li class="item">
                        <h4>基本设置<b>+</b></h4>
                        <div class="info" id="divfold1" style="display: block;">
                        </div>
                    </li>
                    <li class="item">
                        <h4>基本设置2<b>+</b></h4>
                        <div class="info" id="divfold2" style="display: block;">
                        </div>
                    </li>
                    <li class="item">
                        <h4>基本设置3<b>+</b></h4>
                        <div class="info" id="divfold3" style="display: block;"></div>
                    </li>
                    <li class="item">
                        <h4>审核日志<b>+</b></h4>
                        <div class="info" id="divfold4" style="display: block;"></div>
                    </li>
                </ul>
            </div>
            <div class="row cl">
                <div class="col-6 col-offset-4">
                    <button onclick="changeshowtype();" class="btn btn-danger radius" type="button">切换显示</button>
                    <button class="btn btn-primary radius" type="submit" id="btn_hcrwf_save" style="display: none;">保存</button>&nbsp;&nbsp;
				<!--<button class="btn btn-secondary radius" type="button" id="btn_reset">重置</button>&nbsp;&nbsp;-->
                    <button onclick="layer_close();" class="btn btn-default radius" type="button">返回</button>&nbsp;&nbsp;
                </div>
            </div>
            <div class="row cl">
                <div class="col-10" id="divforhcrfbutton" style="text-align: center;">
                </div>
            </div>
        </form>
    </div>
    <script src="../hcjsui/Scripts/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="../lib/icheck/jquery.icheck.min.js"></script>
    <script type="text/javascript" src="../lib/Validform/5.3.2/Validform.js"></script>
    <script type="text/javascript" src="../lib/layer/1.9.3/layer.js"></script>
    <script src="../hcjsui/js/_Define.js" type="text/javascript"></script>
    <script type="text/javascript" src="../js/hcui.js"></script>
    <script type="text/javascript" src="../js/hcui_au_wf.js"></script>
    <script type="text/javascript" src="../js/hcrainwf.js"></script>
    <script type="text/javascript" src="../lib/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="../lib/datatables/1.10.0/jtable.js"></script>
    <script type="text/javascript" src="../js/hcui_list.js"></script>

    <!-- 文件上传方法SSSSSSSSSSSSSSS-->
    <link href="../uploadifyjs/uploadify.css" rel="stylesheet" type="text/css" />
    <script src="../uploadifyjs/swfobject.js" type="text/javascript"></script>
    <script src="../uploadifyjs/jquery.uploadify.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="../newbasejs/uploadifyui.js"></script>
    <!-- 文件上传方法EEEEEEEEEEEEEEE-->
    <script type="text/javascript">
        var divshowtype = 1;
        //加载处理
        function loadin() {
            //本页面 
            spsetBase("order_sp", "id", "order_sp as T", "*", "#tablelist", "hsflow", "工程组件", "hhwork_gcpage");

            $.Huitab("#tab-category .tabBar span", "#tab-category .tabCon", "current", "click", "0");

            $.Huifold("#Huifold2 .item h4", "#Huifold2 .item .info", "", 3, "click");
        }
        function loadback(data) {
            hcrfbutton();
            console.log(hcmtable);
          

            if (Hcaumid && (hcmtable == null || hcmtable == 'undefined')) {
                alert(1);
                hcmtable = $("#tablelist").DataTable({
                    "serverSide": true,//服务端处理分页 无法使用当前查找
                    "bFilter": false,  //是否使用内置的过滤功能
                    //"bInfo": false,//页脚信息
                    //"bPaginate": false, //翻页功能
                    "bLengthChange": false, //改变每页显示数据数量
                    "ajax": {
                        "type": "POST",
                        "url": sposelUrl("table_sp", "id,fv1,fv2,fv3,fv4,fv5,fv6,nv1", " and maintype=" + Hcaumid) + "&sporderby=fv4,id",
                        "data": function (d) {
                        }
                    },
                    aLengthMenu: [100],
                    "columns": [
                         { "data": "id" }
    , { "data": "fv4" }
    , { "data": "fv1" }
   , { "data": "fv2" }
   , { "data": "nv1" }, { "data": "fv5" }, { "data": "fv6" }
    , { "data": "id" }

                    ],
                    "columnDefs": [

                        {
                            "targets": [7],
                            "render": function (data, type, row) {
                                return "<a style=\"text-decoration:none\" class=\"ml-5\" onclick=\"toolUpdateById('" + data + "','','')\" href=\"javascript:;\" title=\"编辑\"><i class=\"Hui-iconfont\">&#xe6df;编辑</i></a> " +
                                       "<a style=\"text-decoration:none\" class=\"ml-5\" onclick=\"toolDelete('" + data + "','table_sp','id')\"     href=\"javascript:;\" title=\"删除\"><i class=\"Hui-iconfont\">&#xe6e2;删除</i></a>";
                            }
                        },

                    {
                        "orderable": false,
                        "targets": [0, 1, 2, 3, 4, 5]
                    }
                    ]
                });
            }

        }
        function addWfNext() {
            toolAdd("新增组件", "hhwork_gcpage-ae.html?action=add&maintype=" + Hcaumid);
        }

        //切换事件
        function changeshowtype() {
            if (divshowtype == 1) {
                $("#divshow1").appendTo("#divfold1");
                $("#divshow2").appendTo("#divfold2");
                $("#divshow3").appendTo("#divfold3");
                $("#divshow4").appendTo("#divfold4");
                $("#fold_category").show();
                $("#tab-category").hide();

                divshowtype = 2;
            }
            else {
                $("#divshow1").appendTo("#divtab1");
                $("#divshow2").appendTo("#divtab2");
                $("#divshow3").appendTo("#divtab3");
                $("#divshow4").appendTo("#divtab4");
                $("#fold_category").hide();
                $("#tab-category").show();
                divshowtype = 1;
            }

        }
    </script>

</body>
</html>
